1. Field of the Invention
The present invention relates to a code quantity assignment device and method for encoding a video signal and storing it in a storage medium in compression encode data storing.
2. Description of the Related Art
In the case of storing a digitalized image, into a storage medium such as a DVD-ROM, a CD-ROM, and a hard disk, it is generally compressed and encoded because the data amount becomes extravagant. This coding method includes various compression-coding methods. Especially, a coding method based on the DCT (Discrete Cosine Transform) for performing compression by using such a property that spatial frequency of an image concentrates on low frequency is comparatively used in many cases. The DCT is used in the coding of the international standard such as JPEG (Joint Photographic Coding Experts Group), MPEG (Moving Picture Coding Experts Group) 1, MPEG 2, and MPEG 4.
In the conventional compression-coding device by the MPEG method, it is well known that the coding is controlled by a fixed bit rate coding method, or a variable bit rate coding method.
In the fixed bit rate coding method, the target code quantity of each frame forming a video sequence is constant, regardless of complexity of the image, and the coding is controlled so as to avoid overflow and underflow, while estimating the occupation rate of a decoder buffer at a time of coding.
On the other hand, in the variable bit rate coding method, since the optimum code quantity amount of each frame within a video sequence has been previously assigned based on a previously-obtained index showing the complexity of an image, it is possible to assign the code quantity necessary for each frame and restrain the difference in image quality between frames.
Since the coded quantity of each frame is relative to the image complexity index of the corresponding image, assignment of code quantity of each frame regardless of the image complexity index would cause unevenness to the image quality of each frame. When much more code quantity is required, the code quantity assignment by consideration of the occupation rate of a decoder buffer at a time of encoding would cause deterioration in image quality since it cannot assign a large code quantity to a frame because of a small space of the buffer, and even when a smaller code quantity can assure sufficient image quality, a larger code quantity would be assigned because of a large space of the buffer.
On the other hand, the code quantity assignment of each frame simply based on the image complexity index would cause overflow or underflow in the decoder buffer.